// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获取用户列表 */
export async function getCustomList(params: API.User.userParam) {
  return request('/api/customer', {
    method: 'GET',
    params,
  });
}

/** 新增用户 */
export async function addCustom(data: API.User.userParam) {
  return request('/api/customer/addCustomer', {
    method: 'POST',
    data,
  });
}

/** 修改用户 */
export async function updateCustom(data: API.User.userParam) {
  return request('/api/customer/updateCustomer', {
    method: 'POST',
    data,
  });
}

/** 删除用户 */
export async function deleteCustom(id: string) {
  return request(`/api/customer/deleteCustomer`, {
    method: 'delete',
    params: { id },
  });
}

/** 客户选择组件 */
export async function getCusSelect() {
  return request(`/api/customer/select`, {
    method: 'GET',
  });
}

/** 获取我的客户 */
export async function getMyCustomer(params: { id: number }) {
  return request(`/api/customer/getMyCustomer`, {
    method: 'GET',
    params,
  });
}
